package cn.kgc.kgczuulserver.filter;

import com.netflix.zuul.ZuulFilter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author geQiang
 * @version 1.0
 * @date 2019/4/14
 * @description cn.kgc.kgczuulserver.filter
 */
@Component
public class PreFilter extends ZuulFilter {

    @Value("${tokenValidation}")
    private String tokenValidation;

    @Override
    public String filterType() {
        return null;
    }

    @Override
    public int filterOrder() {
        return 0;
    }

    @Override
    public boolean shouldFilter() {
        return false;
    }

    @Override
    public Object run() {
        if (tokenValidation != null) {
            return "pass";
        }
        return null;
    }
}
